<template>
  <div class="bread">
    <i
      :class="this.openFlag ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
      @click="OpenOrClose"
    ></i>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ name: 'home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item
        v-for="(item, index) in $store.getters.list"
        :key="index"
        >{{ item }}</el-breadcrumb-item
      >
    </el-breadcrumb>
  </div>
</template>
<script>
export default {
  data () {
    return {
      coll: 'el-icon-s-unfold',
      openFlag: true
    }
  },
  created () {},
  methods: {
    OpenOrClose () {
      //组件传参
      this.openFlag = !this.openFlag
      this.$bus.$emit('sendcatch', this.openFlag)
    }
  }
}
</script>
<style lang="less" scoped>
.bread {
  display: flex;
  margin-left: 20px;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 20px;
  align-items: center;
}
</style>
